0# -*- coding:utf-8 -*-
# coding=utf-8

from ctypes import sizeof
from fileinput import filename
import os
import string


filePath = "."
targetPath = "./uni_hb_m_solution/unione_lite_app_hb_m"
renamePath = "./uni_hb_m_solution"

if __name__ == '__main__':

	srcFileName = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
	print("src file name " + srcFileName)
	SrcSplitName = srcFileName.split("\\")#文件名拆分
	print(SrcSplitName[-1])
	SrcName = SrcSplitName[-1].split("_")#文件名拆分
	print(SrcName[0])
	targetFileName = os.listdir(targetPath)#获取文件夹内文件名

	for fileName in targetFileName:
		print(fileName)
		tarSplitName = fileName.split("_")#文件名拆分
		if SrcName[0] == tarSplitName[0]:
			print("get file name " + fileName)
			newName = "./uni_hb_m_solution/" + fileName
			os.rename(targetPath, newName)#重命名
			break